#include<iostream>
#include<type_traits>
using namespace std;

template<typename T>
struct add_const_ref{
	typedef const T& value_type;
};

template<typename T>
struct add_const_ref<T&>{
	typedef T value_type;
};
template<typename T>
struct add_const_ref<T&&> {
	typedef T value_type;
};

template<typename T>
struct is_const_ref {
	constexpr static bool value = false;
};
template<typename T>
struct is_const_ref<T&> {
	constexpr static bool value = true;
};

int main(void) {

	cout << is_const_ref< add_const_ref<int>::value_type >::value << endl;
	cout << is_const_ref< add_const_ref<int&>::value_type>::value << endl;
	getchar();
	return 0;
}